<?php

class Html_Render_Select
{
	
	public function render($element)
	{
		/**
		 * get all options
		 */
		$multi = $element -> getMultiOptions();
		$name = $element -> getName();
		$xhtml = array();
		$value = $element -> getValue();
				
		foreach ($multi as $key => $label)
		{
			$xhtml[] = sprintf('<option %s value="%s" label="%s"/>%s</label>', ($key==$value?'selected="selected"':''), $key, $label, $label);
		}
		
		
		return sprintf('<select %s>%s</select>', $element->__flat(),implode('', $xhtml)); ;
	}

}
